#!/usr/bin/env python

import os, sqlite3

def run():
	#make a copy of the sms.db and call it sms.vac.db
	os.system("scp sms.db sms.vac.db")
	
	#now vacuum the sms.vac.db
	os.system("sqlite3 sms.vac.db vacuum")
	
	#get the string value of sms.db in 1.txt
	os.system("strings sms.db>1.txt")	
	
	#get the string value of sms.vac.db in 2.txt
	os.system("strings sms.vac.db>2.txt")
	
	#remove the unwanted headers in 1.txt and 2.txt
	os.system("sed -e '1, 43d' 1.txt>tempfile")
	os.system("mv tempfile 1.txt")
	os.system("sed -e '1, 42d' 2.txt>tempfile")
	os.system("mv tempfile 2.txt")

	#now get the actual diff values by grepping the difference in the files
	os.system("grep -F -x -v -f 2.txt 1.txt")

	#now delete all the files that were created
	os.system("rm 1.txt")
	os.system("rm 2.txt")
	os.system("rm sms.vac.db")
def main():
	#execute the run function
	run()

if __name__ == '__main__':
	main()